<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        /* 容器 flex-direction  容器默认占用一行。*/
        
        .out {
            display: flex;
            height: 300px;
            width: 300px;
            /* 确定主轴方向 */
            flex-direction: row;
            /* justify-content: center;
            align-items: center; */
            /* span-around 周围为空，space-btween 中间平分*/
            justify-content: space-between;
            background-color: pink;
            /* 是否换行 */
            flex-wrap: wrap;
            /* 副轴 align-item */
            align-items: flex-start;
            /* 多行用aligin-content */
            align-content: flex-start;
        }
        /* 项目 */
        
        span {
            /* flex: 1; 分配剩余空间。*/
            width: 90px;
            height: 90px;
            margin-left: 10px;
            background-color: purple;
        }
    </style>
</head>

<body>
    <div class="out">
        <span class="span">1</span>
        <span class="span">2</span>
        <span class="span">3</span>
        <span class="span">4</span>
    </div>
</body>

</html>